package mahi.inheritance;

public class CopyOfTest {
		public static void main(String[] args) {
		
			
			
			
			
			
			Child child = new Child();
			Parent parent = new Parent();
			
			
			//Upcasting
			Parent p0 = parent;
			Parent p1 = child;
			
			
			
			Parent p2 = new Child();
			Parent  p3 =  new Cousin();
			
			
		
			p0.test();  //// test method of Parent will get called
			p2.test();  // test method of child will get called
			p3.test(); // test method of Cousin will get called
			
			
			
			
			p2 = new Cousin();
			
			p2.test(); //print cousing test
			

		}

	
}
